
<template>
	<div class="tabberWarp" >
		<div class="warp">
			<Item :txt='item.txt' :page='item.page' @change='getVal' v-for='(item,index) in tabbarDes' :key="index" :sel='selected'>
				<img :src="item.normalImg" slot='normalImg'>
				<img :src="item.activeImg" slot='activeImg'>
			</Item>
		</div>
	</div>
</template>
<script type="text/javascript">
	import Item from './Item.vue'
	export default {
		components: {
			Item
		},
		data: function () {
			return {
				selected: '',
				tabbarDes: [
					{
						txt: '游戏',
						page: '',
						normalImg: require('@/assets/tabbar/index.png'),
						activeImg: require('@/assets/tabbar/indexa.png')
						
					}, 				
					{
						txt: '分红',
						page: 'user',
						normalImg: require('@/assets/tabbar/red.png'),
						activeImg: require('@/assets/tabbar/reda.png')
					},  
					{
						txt: '商城',
						page: 'order',
						normalImg: require('@/assets/tabbar/shop.png'),
						activeImg: require('@/assets/tabbar/shopa.png')
					}, 
					{
						txt: '收益',
						page: 'mine',
						normalImg: require('@/assets/tabbar/shou.png'),
						activeImg: require('@/assets/tabbar/shoua.png')
					}, 
						{
						txt: '我的',
						page: 'userInfo',
						normalImg: require('@/assets/tabbar/user.png'),
						activeImg: require('@/assets/tabbar/usera.png')
					},
				]
			}
		},
		methods: {
			getVal (res) {
				this.selected = res 
			}
		}
	}
</script>
<style type="text/css">
	.warp{
		width: 100%;
		border-top: 1px solid #eee;
		background: #fff;
		display: flex;
		align-items: center;
		justify-content: space-around;
		font-size: 0;
	}
	.warp img{
		width: 20px;
		height: 20px;
	}
	.tabberWarp img{
		margin-top: 10px;
		margin-bottom: 5px;
 
	}
	.tabberWarp{
		position: fixed;
		bottom: 0;
		left: 0;
		width: 100%;
		padding-bottom: 5px;
		background: #fff;
	}
</style>
